package com.yuntsg.nnsfcp.test;

import cn.hutool.db.Db;
import com.alibaba.fastjson.JSONObject;
import com.yuntsg.nnsfcp.entity.BiaoshuEntity;
import com.yuntsg.nnsfcp.front.entity.BidBackCompare;
import com.yuntsg.nnsfcp.util.CompareUtils;

import java.sql.SQLException;
import java.util.List;

/**
 * @Author: 葛成瑞
 * @Date: 2024/10/10 14:14
 */
public class 比对工具改写测试 {


    public static void main(String[] args) throws SQLException {
        Db use = Db.use();
        List<BidBackCompare> query = use.query("select * from bid_back_compare where id = 1", BidBackCompare.class);
        BidBackCompare bidBackCompare = query.get(0);
        BiaoshuEntity biaoshuEntity = JSONObject.parseObject(bidBackCompare.getOrg(), BiaoshuEntity.class);
        BiaoshuEntity biaoshuEntitymodi = JSONObject.parseObject(bidBackCompare.getModi(), BiaoshuEntity.class);
        String res = new CompareUtils<BiaoshuEntity>().compare(biaoshuEntity, biaoshuEntitymodi);
        System.out.println(res);
    }

}
